package com.movie2.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

// @WebFilter
public class Myfilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletResponse resp=(HttpServletResponse) servletResponse;
        resp.setHeader("Access-Control-Allow-Origin","*");
        resp.setHeader("Access-control-Allow-Headers","Accept-Key");
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
